class DialogPanel extends Panel {
    /**
     * 是否缓动完成
     */
    public ui: laya.ui.Dialog;

    //显示ui
    protected showUi=()=>{
        if(this.initFlag == false){
            this.ui = new this.uiClass();
            this.initFlag = true;
            this.onFirst();
        }
        this.ui.popup();
        this.ui.on(Laya.Event.REMOVED,this,this.onRemove);
        this.onShow();
        // MusicManager.playSound(MusicManager.OPEN_PANEL);
    }

    //关闭 Dialog
    close=()=>{
        if(this.ui == null || this.ui.parent == null){
            return;
        }
        this.ui.close();
    }

    //从舞台移除
    private onRemove=()=>{
        this.ui.off(Laya.Event.REMOVED,this,this.onRemove);
        this.onClose();
        // MusicManager.playSound(MusicManager.CLOSE_PANEL);
    }
}